<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j">
<head>
<title>#{bundle.painelaluno}</title>
</head>
<body>
	<div id="accordion">
		<rich:simpleTogglePanel label="#{bundle.painelcadaluno}" switchType="client">
			<div>
				<div>
					<h:form id="cadalu">
				#{bundle.painelnome}<br />
						<h:inputText required="true" id="nomAlu" size="60" value="#{pUserBean.nome}" />
						<h:message for="nomAlu" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
				#{bundle.painellogin}<br />
						<h:inputText required="true" id="logAlu" value="#{pUserBean.login}">
							<f:validator validatorId="chaveValidator" />
							<f:attribute name="tipo" value="Usuario" />
							<f:converter converterId="KeyLowerCaseConverter"/>
						</h:inputText>
						<h:message for="logAlu" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
				#{bundle.painelsenha}<br />
						<h:inputText required="true" id="senhaAlu" value="#{pUserBean.senha}">
							<f:converter converterId = "HashSenhaConverter" />
							<f:validateLength minimum="5" />
						</h:inputText>
						<h:message for="senhaAlu" style="color: blue;font-weight: bold;margin-left: 10px;" />
						<br />
						<br />
						<h:commandButton value="#{bundle.painelcad}" action="#{pUserBean.cadastrar}">
							<f:setPropertyActionListener value="Aluno"
								target="#{pUserBean.tipo}" />
						</h:commandButton>
					</h:form>
				</div>
			</div>
		</rich:simpleTogglePanel>
		<rich:simpleTogglePanel label="#{bundle.painelveraluno}" switchType="client">
			<div>
				<div>
					<h:form>
						<h:dataTable bgcolor="#F8F8FF" cellpadding="10px" width="100%"
							headerClass="head_listacurso" styleClass="table_listapainel"
							rowClasses="tr_listapainel" value="#{pUserBean.listaAlunos}"
							var="a" id="dtpanalu">
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painellogin}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{a.login}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painelhashsenha}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{a.senha} " />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>
										<b>#{bundle.painelnome}</b>
									</h:outputText>
								</f:facet>
								<h:outputFormat value="#{a.nome}" />
							</h:column>
							<h:column>
								<f:facet name="header">
									<h:outputText>#{bundle.painelacoes}</h:outputText>
								</f:facet>
								<a4j:commandButton action="#{eUserBean.carregar}" value="#{bundle.paineleditar}" id="atualAluno"
									 oncomplete="Richfaces.showModalPanel('panelAlu')" reRender="nomeAlu,loginAlu,passAlu,chk_alu">
									<f:setPropertyActionListener value="#{a}"
										target="#{eUserBean.atual}" />									
								</a4j:commandButton>
								<h:commandButton action="#{pUserBean.deletar}" value="#{bundle.painelexcluir}"
									onclick="return confirm('#{bundle.paineloconfirmexcluiraluno}');">
									<f:setPropertyActionListener value="#{a.login}"
										target="#{pUserBean.logDel}" />
									<f:setPropertyActionListener value="Aluno"
										target="#{pUserBean.tipo}" />
								</h:commandButton>
							</h:column>
						</h:dataTable>
					</h:form>
					<f:subview id="editaluno">
						<ui:include src="/editaraluno.xhtml" />
					</f:subview>
				</div>
			</div>
		</rich:simpleTogglePanel>
	</div>
</body>
</html>